from django.db import models

# Create your models here.
class QuestionType(models.Model):
	question_type = models.CharField(max_length = 50)
	
	def __str__(self):
		return self.question_type
		
class Question(models.Model):
	question_type = models.ForeignKey(QuestionType,
	on_delete = models.CASCADE)
	question_text = models.CharField(
	max_length = 200,unique = True)
	pub_date = models.DateTimeField(auto_now_add = True)
	
	def __str__(self):
		return self.question_text
	
class Choice(models.Model):
	question = models.ForeignKey(Question,
	on_delete = models.CASCADE)
	choice_text = models.CharField(max_length = 100)
	
	def __str__(self):
		return self.choice_text
	
class Answer(models.Model):
	question = models.ForeignKey(Question,
	on_delete = models.CASCADE)
	answer_text = models.CharField(max_length = 300)
	
	def __str__(self):
		return self.answer_text
	